/*
 * Queue.h
 *
 *  Created on: 2012-04-12
 *      Author: tony
 */

#ifndef QUEUE_H_
#define QUEUE_H_

#include <cstddef>

namespace graph {

template<class T>
class Node {
public:
	Node(T d, Node* n = NULL, Node* p = NULL): data(d), next(n), prev(p) { }
	virtual ~Node(){}

	T get(){ return data; }
	void set(T d){ data = d; }

	Node* getNext(){ return next; }
	void setNext(Node* n){ next = n; }

	Node* getPrev(){ return prev; }
	void setPrev(Node* p){ prev = p; }

private:
	T data;
	Node* next;
	Node* prev;
};


template<class T>
class Queue {
public:
	Queue();
	virtual ~Queue();

	void enqueue( T d );
	T dequeue();
	bool is_empty();

private:
	Node<T>* front;
	Node<T>* back;
};

} /* namespace graph */
#endif /* QUEUE_H_ */
